package day0925;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * 求两个数的最小公倍数LCM（Least Common Multiple）
 * @author chenxiaokang
 *
 */

public class Ques1014 {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		List<Long> aList = new ArrayList<Long>();
		List<Long> bList = new ArrayList<Long>();
		List<Long> resultList = new ArrayList<Long>();
		long a = 0;
		long b = 0;
		long result = 0;
		long divisor = 0;
		while(scan.hasNext()){
			a = scan.nextInt();
			b = scan.nextInt();
			if(a == 0 && b == 0){
				for(long re : resultList){
					System.out.println(re);
				}
				resultList = new ArrayList<Long>();
			}
			if(a != 0 && b != 0){
				aList.add(a);
				bList.add(b);
				divisor = Ques1014.divisor(a, b); 
				result = a * b / (divisor);
				resultList.add(result);
			}else if(a == 0 && b != 0){
				resultList.add(0L);
			}else if(a != 0 && b ==0){
				resultList.add(0L);
			}
		}
	}
	
	 public static long divisor(long a,long b){
		 long remainder = 0;
		 if(a > b){
			 remainder = a % b;
			 if(remainder == 0){
				 return b;
			 }
			 return divisor(remainder,b);
		 }else{
			 remainder = b % a;
			 if(remainder == 0){
				 return a;
			 }
			 return divisor(remainder,a);
		 }
	 }
}